#include "../base/base_tracker.h"
#include "../utils/file_save_util.h"
#include <csignal>

#ifndef TRACKER_
#define TRACKER_

#define TRACKER_TAG "armeabi-v7a"
#define RAISE_SIGN SIGUSR1

typedef void (*ReportCallback)(const std::string &);

class Tracker : public BaseTracker
{
private:
    struct sigaction actionNew;
    int isRegister = 0;

    /// function...
public:
    void track() override;

    void registerSignalListener() override;

    void unregisterSignalListener() override;

    void setBaseIsolateInstructions(uint64_t isolateInstructions, uint64_t vmInstructions) override;

    ~Tracker() override;

private:
    static void trackerActionWithSignum(int signum, siginfo_t *info, void *invokeContext);

    static ReportCallback reportCallback;
};

#endif